<!DOCTYPE html>

<html>

	<head>
		<meta charset="utf-8">
		<title>产品页</title>
		<link rel="stylesheet" href="<?php echo __PUBLIC__?>/Home/less/index.css" />
		<link rel="stylesheet" href="<?php echo __PUBLIC__?>/Home/less/chanpin.css" />
		<link rel="stylesheet" href="<?php echo __PUBLIC__?>/Home/less/bottom.css" />
		<script src="<?php echo __PUBLIC__?>/Home/city/jquery-1.8.2.min.js"></script>
		<link href="<?php echo __PUBLIC__?>/fangdajing/css/base.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<?php echo __PUBLIC__?>/fangdajing/js/jquery.jqzoom.js"></script>
		<script type="text/javascript" src="<?php echo __PUBLIC__?>/fangdajing/js/base.js"></script>
	</head>

	<body>
		<!--载入公共头部-->
					<div id="top">
			<div class="nr">
				<div class="left">
					                
					<span class="welcome">您好,<a href="http://localhost/myshop/index.php?m=Home&c=Myheart&a=index">12345678901</a>!</span>
					<span class="login"style="width:140px;margin-left:-30px;">
						<a href="http://localhost/myshop/index.php?m=Home&c=Login&a=out">退出登录</a>|<a href="http://localhost/myshop/index.php?m=Home&c=Login&a=index">更换用户</a>
					</span>
										<li><a href="">我的订单</a></li> 
					<li><a href="">收藏本站</a></li>
					<li><a href="" class='red'>双十一退换货说明</a></li>

				</div>
				<div class="right">
					<li class='fanke'><a href="">我的凡客<span class='erji'>我的订单</span></a><span class='ico'>
						
					</span></li>
					<li><a href="">网站导航</a><span class='ico'></span></li>
					<li><a href="">网站导航</a><span class='ico'></span></li>
					<li><a href="">帮助中心</a><span class='ico'></span></li>
					<li><a href="">网站公告</a><span class='ico'></span></li>
					<li><a href="">手机凡客</a><span class='mobel'></span></li>
					<li><a href="">在线客服</a><span class='kefu'></span></li>
					<span class="weixin"></span>
					<span class="weibo"></span>

				</div>
			</div>
		</div>
		<div id="search">
			<div class="search">
				<div class="left">
					
				</div>
				<div class="mid">
					<form action='' method="post">
						<input type="text" name="hh" value="男士羽绒服" class='text' />
						<input type="submit" value="搜索"class='btn' />
					</form>
					<p>
						<span>热门搜索：</span>
						<a href="">衬衫</a>
					<a href="">羽绒服</a>
					<a href="">针织衫</a>
					<a href="">羊毛外套</a>
					<a href="">休闲裤</a>
					<a href="">牛仔裤</a>
					</p>
				</div>
				<div class="cart">
					<div class="top">
						<span>购物车</span>
						
					</div>
					                {
						<p><a href="http://localhost/myshop/index.php?m=Home&c=Buycar&a=index"style="color:red;line-height:25px;">你的购物车有<span style="font-size: 20px;margin:0 10px;color:#000000;">0</span>件产品</a></p>
										
						
					
				</div>
			</div>
		</div>
					<!--导航条-->
		<div id="nav">
			<div class="nav">
				<div class="left">
					全部商品分类
				</div>
				<div class="right">
					
					<ul>
												
						<li>
							<a href="http://localhost/myshop/index.php?m=Home&c=List&a=index&cid=25">男装</a>
							<div class="tab">
								<div class="tableft">
									<div class="le">
										<a href="" class="img"><img src="http://localhost/myshop/Public/Home/images/6367352-1j.jpg" alt="" /></a>
									</div>
									
									<div class="re">
										<a href="" class="kuan">男款</a>
										<span class="word">超轻羽绒服 鹅绒造 更保暖 无异味</span>
										<span class="price">￥399</span>
									</div>
									
								</div>
								
								<div class="tableft" style="border:none;">
									<div class="le">
										<a href="" class="img"><img src="http://localhost/myshop/Public/Home/images/6367352-1j.jpg" alt="" /></a>
									</div>
									
									<div class="re">
										<a href="" class="kuan">nv款</a>
										<span class="word">超轻羽绒服 鹅绒造 更保暖 无异味</span>
										<span class="price">￥399</span>
									</div>
									
								</div>
							</div>
						</li>

													
						<li>
							<a href="http://localhost/myshop/index.php?m=Home&c=List&a=index&cid=26">女装</a>
							<div class="tab">
								<div class="tableft">
									<div class="le">
										<a href="" class="img"><img src="http://localhost/myshop/Public/Home/images/6367352-1j.jpg" alt="" /></a>
									</div>
									
									<div class="re">
										<a href="" class="kuan">男款</a>
										<span class="word">超轻羽绒服 鹅绒造 更保暖 无异味</span>
										<span class="price">￥399</span>
									</div>
									
								</div>
								
								<div class="tableft" style="border:none;">
									<div class="le">
										<a href="" class="img"><img src="http://localhost/myshop/Public/Home/images/6367352-1j.jpg" alt="" /></a>
									</div>
									
									<div class="re">
										<a href="" class="kuan">nv款</a>
										<span class="word">超轻羽绒服 鹅绒造 更保暖 无异味</span>
										<span class="price">￥399</span>
									</div>
									
								</div>
							</div>
						</li>

													
						<li>
							<a href="http://localhost/myshop/index.php?m=Home&c=List&a=index&cid=27">鞋子</a>
							<div class="tab">
								<div class="tableft">
									<div class="le">
										<a href="" class="img"><img src="http://localhost/myshop/Public/Home/images/6367352-1j.jpg" alt="" /></a>
									</div>
									
									<div class="re">
										<a href="" class="kuan">男款</a>
										<span class="word">超轻羽绒服 鹅绒造 更保暖 无异味</span>
										<span class="price">￥399</span>
									</div>
									
								</div>
								
								<div class="tableft" style="border:none;">
									<div class="le">
										<a href="" class="img"><img src="http://localhost/myshop/Public/Home/images/6367352-1j.jpg" alt="" /></a>
									</div>
									
									<div class="re">
										<a href="" class="kuan">nv款</a>
										<span class="word">超轻羽绒服 鹅绒造 更保暖 无异味</span>
										<span class="price">￥399</span>
									</div>
									
								</div>
							</div>
						</li>

								
						
					</ul>
				
				</div>
			
			</div>
		</div>
	
		<!--产品详情页面开始-->

		<div id="chanpin">
			<div class="head">
				<p>
					<a href="<?php echo U('Index/index')?>" class='first'>首页</a> >
					<a href="">运动户外</a> >
					<a href="">男运动装</a> >
					<a href=""> 羽绒服</a> >
					<a href="">凡客羽绒服</a>
					<a href="">超轻鹅绒</a>
					<a href="">立领</a>
					<a href="">男款</a>
				</p>
				<div class="title">
					<?php foreach ($goodsdata as $v){?>
					<h2><?php echo $v['gname']?></h2>
					<?php }?>
					<div>
						<a href="">产品描述</a>
						<a href="">评论 </a>
						<a href="">提问</a>
					</div>

				</div>

			</div>
			
			<!--产品区-->
			<div class="product">
				
				<div class="loupe">
					<!--放大镜-->
					<!--放大镜开始-->
					
				  <div class="fangleft"style='width:500px;float:left;margin:30px 0 0 50px;'>
				  	
				  	
				    <div id="preview" class="spec-preview"> <span class="jqzoom"><img jqimg="<?php echo __PUBLIC__?>/<?php echo $gddata['php'][0]['big']?>" src="<?php echo __PUBLIC__?>/{{$gddata['php'][0]['mid']" /></span> </div>
				  
				    <div class="spec-scroll"> <a class="prev">&lt;</a> <a class="next">&gt;</a>
				      <div class="items">
				        <ul>
				        	 <?php foreach ($gddata['php'] as $v){?>
				          <li><img  bimg="<?php echo $v['big']?>" src="<?php echo $v['mid']?>" onmousemove="preview(this);"></li>
				          
				          <?php }?>
				          
				          
				        </ul>
				      </div>
					</div>
				    
				  </div>
					<!--放大镜结束-->
					<!--产品区-->
					
					<!--通过异步发送所选内容-->
					<script type="text/javascript">
						$(function(){
							
//							选中对应属框变红，出现小三角
							$('.color ul li').click(function(){
								
								$(this).find('a').addClass('border').parent('li').siblings().find('a').removeClass('border');
								$(this).find('a span').addClass('bj').parents('li').siblings().find('a span').removeClass('bj');
//								获得隐藏于的值商品id
								var gid=$('input[name=gid]').val();
//								
//								获得商品旧价格
								var oldprice=$('input[name=shopprice]').val();
//								定义空字符串用来存放规格的gtid
								var gaid='';
//								定义空字符串用来存放规格值
								var spec='';
//								定义空字符串用来存放附加价格
								var addprice='';
								var a=$('.border').length;
								$.each($('.border'),function(){
									gaid+=$(this).attr('attr')+',';
									
									addprice=addprice*1+parseInt($(this).attr('addprice'))*1;
								});
//								alert(gaid);
//								alert(addprice);
//								获得新的价格
								var newprice=oldprice*1+addprice*1;
//								alert(newprice);
//								将新的价格返回页面
								$('.newprice').html(newprice);
//								将所选颜色和尺码返回页面
								
//								库存
								var inventory="";								
								$.ajax({
								//			请求地址
										url:'<?php echo U('Ajaxbuy')?>',
										data:{gaid:gaid,gid:gid},
										type:'post',
										dataType:'json',
										success:function(phpData){
											
//														console.log(phpData);
												//	对应库存										
												inventory+= phpData.inventory;
												//	alert(inventory);
											
												//	分配到页面
												$('.inventory').html(inventory);
										}
										
										
								});
								return false;
							})
						})
					</script>
					<!--提交购物车值-->
					<!--提交到购物车的值-->
					<script type="text/javascript">
						$(function(){
							$('.buycar').click(function(){
//								获得购买商品id/
								var gid=$('input[name=gid]').val();
//								alert(gid);
//								获得购买商品的数量
								var num=$('input[name=num]').val();
								
//								alert(num);
//								获得购买商品的规格
								var gaid='';
								$.each($('.border'),function(){
									gaid+=$(this).attr('attr')+',';									
									
								});
								//	异步请求
								$.ajax({
									url:"<?php echo U("Buycar/add")?>",
								//	发送数据
									data:{gid:gid,num:num,gaid:gaid},
								//		类型
									type:'post',
									dataType:'json',
									success:function(phpDa){
//										console.log(phpDa);
										//	分配到页面中
									var str='添加成功!一共'+phpDa+'件商品';	
										$('.success').append(str);
									}
								})
							})
						})		
					</script>
								
					<form action="" method="post"id="msg">
						<?php foreach ($goodsdata as $v){?>
						<div class="right">
							<!--隐藏于存放商品id-->
							<input type="hidden" name="gid" value="<?php echo $v['gid']?>" />
							<!--商品名称-->
							<p><h3><?php echo $v['gname']?></h3></p>
							<input type="hidden" name="gname" value="<?php echo $v['gname']?>"/>
							<p class="price">
								
								<span class='sellprice'> 售价： </span>
								<span class='rmb'>￥<strong class='newprice'><?php echo $v['shopprice']?></strong></span>
								<input type="hidden" name="shopprice" value="<?php echo $v['shopprice']?>"/>
							</p>
							<!--规格区域-->
							<?php foreach ($attr1 as $ak=>$av){?>
							<div class="color">
								<div class="colors"><?php echo $ak?></div>
								<ul>
									<?php foreach ($av as $aav){?>
									
									<li>
										<a attr="<?php echo $aav['gaid']?>" addprice="<?php echo $aav['addprice']?>" href="javascript:;">
											
											<span></span>
											<?php echo $aav['gavalue']?>
											<input type="hidden" name="guige[]"value="<?php echo $aav['gavalue']?>" />
										</a>

									</li>
									<?php }?>
									
								</ul>
							</div>
							<?php }?>
						
							
							
							<div class="number">
								<span class="num">数量:</span>
								<!--选择数量的js-->
								<!--数量增加减少-->
								<script type="text/javascript">
		                     $(function(){
		                     	$('.icon_min').click(function(){
		                     		var nu=$('.nu').val();
//		                     		alert(nu);
		                     		nu=Number(nu);
		                     		if(nu<=0){
		                     			nu=0;
		                     		}else{
		                     			nu--;
		                     			$('.nu').val(nu);
		                     		}
		                     	
		                     	});
		                     	$('.icon_max').click(function() {
		                     		var nu=$('.nu').val();
		                     		nu=Number(nu);
		                     		++nu;
		                     		
		                     		//获取库存数量
		                     		var inventory = $('.inventory').html();
		                            if (nu>=inventory) {
		                            	nu=inventory;
		                            	// return nu;
		                            };
		                            $('.nu').val(nu);
		                            
		                     	});
		                     })
		                  </script>
								<p>
						<a href="javascript:;" class="icon_min"style="width:20px;height:20px;display:inline-block;background:#E04A49;color:white;padding-left: 10px;text-decoration: none;">-</a>
						<input type="text" value="0" class="nu" name="num"style="width:40px;">
						<a href="javascript:;" class="icon_max"style="width:20px;height:20px;display:inline-block;background:#E04A49;color:white;padding-left: 10px;text-decoration: none;">+</a>
					</p>
								
							</div>
							
							<!--汇总-->
							<p class="aggregate">
								<span >库存：</span>
								<span class="inventory">0</span>
								<!--已选： <span>蓝色</span>，<span class='hao'>xl</span> 现在有货-->
							</p>
							<!--点添加购物车-->
							<script  type="text/javascript" >
								$(function(){
//									获得选择的数量
									var num=$('input[name=num]').val();
//									获得库存的数量
									var inventory=$('.inventory').html();
//									alert(inventory);
										
												$('.buycar').attr('href',"<?php echo U('Buycar/index',array('gid'=>$v['gid']))?>");
												$('.nowshop').attr('href',"<?php echo U('Buycar/index',array('gid'=>$v['gid']))?>");
												$('.buycar').click(function(){
											
											
												$('.hid').css('display','block');
												});
												$('.close').click(function(){
													$('.hid').css('display','none');
												});
												$('.countiue').click(function(){
													$('.hid').css('display','none');
												})						
									
								})
							</script>
							<div class="input">
								<a href="<?php echo U('Buycar/index',array('gid'=>$v['gid']))?>"class='nowshop'>立即购买</a>
								<!--<input type="submit" value=""class='buycar' />-->
								<div class="car"><a href="javascript:;"class='buycar'></a>
									<div class="hid">
										<span class="close">x</span>
										<p class="success"></p>
										
										<a href="<?php echo U('Buycar/index',array('gid'=>$v['gid']))?>"class='goon'>去购物车结算</a>
									</div>
									
								</div>
								
							</div>

						</div>
						<?php }?>
					</form>
				</div>
				
				<!--产品描述-->
				<div class="dsc">
					<h4>产品描述：</h4>
					<p class='wenzi'><?php echo $gddata['intro']?> </p>
				</div>
				<!--产品属性-->
				<div class="nature">
					<h4>产品属性：(点击属性可查看同类商品)</h4>
					
					<div class="xxnature">
						
					
							<?php foreach ($spec1 as $k=>$v){?>
								<p class="nul">
									<span><?php echo $k?></span>
									<?php foreach ($v as $vv){?>
									<a href="<?php echo U('List/index')?>"><?php echo $vv['gavalue']?></a>
									<?php }?>
								</p>
								<?php }?>
										
						
					</div>
				</div>
				
				<!--洗涤说明-->
				<div class="wash">
					<h4>洗涤说明：</h4>
					<span class="wbj"></span>
					<span class="wbj"></span>	
					<span class="wbj"></span>
					<span class="wbj"></span>
					<span class="wbj"></span>
					<span class="wbj"></span>
				</div>
				<!--详细图片-->
				<div class="detail">
					<h4>详情图片：</h4>
					<h6> 注： 商品实际颜色以静物图为准 </h6>				
					<img src="<?php echo __PUBLIC__?>/Home/images/nanll_01.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_02.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_03.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_04.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_05.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_06.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_07.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_08.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_09.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_10.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_11.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_12.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_13.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_14.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_15.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_16.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_17.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_18.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_19.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_20.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_21.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_22.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_23.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_24.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_25.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_26.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_27.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_28.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_29.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_30.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_31.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_32.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_33.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_34.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_35.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_36.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_37.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_38.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_39.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_40.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_41.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_42.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_43.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_44.jpg" alt="" /><img src="<?php echo __PUBLIC__?>/Home/images/nanll_45.jpg" alt="" />
				
				</div>
			</div>
			<!--评论开始-->
		<div class="pinglun">
				<!--左侧产品展示-->
				<div class="plleft">
					<span class="ltop">
						热销产品
					</span>
					<ul class="hotbuy">
						<?php foreach ($tuijian as $v){?>
						<li>
							<a href="">
								<img src="<?php echo $v['pic']?>" alt="" />
								<p class="rb"><?php echo $v['gname']?></p>
								
							</a>
							<p class="rjia">
								售价<?php echo $v['shopprice']?>
							</p>
						</li>
						<?php }?>
						
					</ul>											
				</div>
			</div>
		</div>

		<!--公共尾部开始-->
		<!--公共部位-->
		<!--载入公共头部-->
		<!--关于凡客-->
		<div id="vancl">
			<div class="vancl">
				<ul>
					<li>
						<h2>关于凡客</h2></li>
					<li><a href="">公司简介</a></li>
					<li><a href="">联系我们</a></li>
					<li><a href="">友情链接</a></li>
				</ul>

				<ul>

					<h2>新手指南</h2>
					<li><a href="">账户注册</a></li>
					<li><a href="">购物流程</a></li>
					<li><a href="">网站地图</a></li>
					<li><a href="">商家入驻</a></li>
				</ul>

				<ul>

					<h2>配送范围及时间</h2>
					<li><a href="">国内配送</a></li>
					<li><a href="">订单拆分</a></li>
				</ul>

				<ul>

					<h2>支付方式</h2>
					<li><a href="">货到付款</a></li>
					<li><a href="">在线支付</a></li>
					<li><a href="">礼品卡及账户余额</a></li>
					<li><a href="">其他支付方式</a></li>
				</ul>

				<ul>

					<h2>售后服务</h2>
					<li><a href="">退换货政策</a></li>
					<li><a href="">退换货办理流程</a></li>
					<li><a href="">退换货网上办理</a></li>
					<li><a href="">退款说明</a></li>
					<li><a href="">调查问卷</a></li>
				</ul>

				<ul class='end'>

					<h2>帮助中心</h2>
					<li><a href="">在线客服</a></li>
					<li><a href="">找回密码</a></li>
					<li><a href="">隐私声明</a></li>
				</ul>
				
			</div>
			<div class='bj'>
				<dd><a href=""class='one'></a></dd>
				<dd><a href=""class='two'></a></dd>
				<dd><a href=""class='three'></a></dd>
				<dd><a href=""class='four'></a></dd>
		</div>
		</div>
		</div>
		<!--底部-->
		<div id="bottom">
			<div class="bottom">
				<p>Copyright 2007 - 2015 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11011502002400号 出版物经营许可证新出发京批字第直110138号</p>
				<ul>
					<li><a href=""class='one'></a></li>
					<li><a href=""class='two'></a></li>
					<li><a href=""class='three'></a></li>
<li><a href=""class='four'></a></li>

<li><a href=""class='five'></a></li>
<li><a href=""><img src="http://localhost/myshop/Public/Home/images/kexin_brand_for_others.png" alt="" /></a></li>

				</ul>
			</div>
		</div>
	
	</body>

</html>